export default {
    getLoginData: config => {
        console.log(config)
        const { username, pwd } = JSON.parse(config.body);
        var token = '';
        if (username === '张三' && pwd === '123456') {
            token = 'zhangsan---token---afafaefawefesa';
        } else if (username === '李四' && pwd === '123456') {
            token = 'lisi---token---dededessfegfesfef'
        }

        return {
            code: 200,
            msg: token == '' ? '输入错误, 请重新输入' : '登录成功',
            data: {
                token: token
            }
        }
    },
    getUserData: config => {
        const { token } = JSON.parse(config.body);
        var user = {};
        if (token == 'zhangsan---token---afafaefawefesa') {
            user.name = "张三",
                user.rules = "管理员"
        } else if (token == 'lisi---token---dededessfegfesfef') {
            user.name = "李四",
                user.rules = "普通用户"
        }



        return {
            code: 200,
            msg: '获取用户信息',
            data: user
        }
    }
}